file object

The file object is used to read and write files stored on the hard disk.

file()

Parameters:
None.

Remarks:
The file object is initially blank, until a file is associated with it. To associate a file you must call the "open" method specifying a name or a path for the file, and the mode in which the file is opened. You may call the "open" method again at any time if you wish to open a new file, at which point the old file (if any) will be cleared. This, in short, allows you to reuse the same file object to control multiple files.

Example:
// Write some text into a file.

void main()
{
file test;
test.open("c:\\test.txt", "w");
test.write("I am a text file!");
test.close();
}